package com.zhq.bean;

import java.sql.Timestamp;
import java.util.Objects;

/**
 * @Author:钟豪强
 * @Description:    快递员类
 * @Date Created in  2020-08-16 18:53
 * @Modified By:
 */
public class Courier {
    private int id;
    private String username;
    private String userPhone;
    private String userNumber;
    private String password;
    private int expressNumber;
    private Timestamp createTime;
    private Timestamp lastLoginTime;
    private String g_userPhone;
    private boolean admin;

    public Courier() {
    }

    public Courier(int id, String username, String userPhone, String userNumber, String password, int expressNumber, Timestamp createTime, Timestamp lastLoginTime) {
        this.id = id;
        this.username = username;
        this.userPhone = userPhone;
        this.userNumber = userNumber;
        this.password = password;
        this.expressNumber = expressNumber;
        this.createTime = createTime;
        this.lastLoginTime = lastLoginTime;
    }

    public Courier(String username, String userPhone, String userNumber, String password) {
        this.username = username;
        this.userPhone = userPhone;
        this.userNumber = userNumber;
        this.password = password;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getUserPhone() {
        return userPhone;
    }

    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone;
    }

    public String getUserNumber() {
        return userNumber;
    }

    public void setUserNumber(String userNumber) {
        this.userNumber = userNumber;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getExpressNumber() {
        return expressNumber;
    }

    public void setExpressNumber(int expressNumber) {
        this.expressNumber = expressNumber;
    }

    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    public Timestamp getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(Timestamp lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public String getG_userPhone() {
        return g_userPhone;
    }

    public void setG_userPhone(String g_userPhone) {
        this.g_userPhone = g_userPhone;
    }

    public boolean isAdmin() {
        return admin;
    }

    public void setAdmin(boolean admin) {
        this.admin = admin;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Courier courier = (Courier) o;
        return id == courier.id &&
                expressNumber == courier.expressNumber &&
                Objects.equals(username, courier.username) &&
                Objects.equals(userPhone, courier.userPhone) &&
                Objects.equals(userNumber, courier.userNumber) &&
                Objects.equals(password, courier.password) &&
                Objects.equals(createTime, courier.createTime) &&
                Objects.equals(lastLoginTime, courier.lastLoginTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, username, userPhone, userNumber, password, expressNumber, createTime, lastLoginTime);
    }

    @Override
    public String toString() {
        return "Courier{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", userPhone='" + userPhone + '\'' +
                ", userNumber='" + userNumber + '\'' +
                ", password='" + password + '\'' +
                ", expressNumber=" + expressNumber +
                ", createTime=" + createTime +
                ", lastLoginTime=" + lastLoginTime +
                '}';
    }
}
